TARGET = basic-dialog.exe
SRCS = widget.c callback.c delegate.c dialog.c exitbutton.c titlebar.c graph.c\
	   label.c main.c
INCS = widget.h callback.h delegate.h dialog.h exitbutton.h titlebar.h graph.h\
	   label.h
OBJS = $(SRCS:.c=.o)
CFLAGS = -Wall -D BUILD_STATIC
LFLAGS = -s -lgdi32
CC = gcc

# link the projects if all its objects is up to date
$(TARGET) : $(OBJS)
	$(CC) $(OBJS) -o $(TARGET) $(LFLAGS)

# compile object if it do not exist or if its been updated
.c.o :
	$(CC) $(CFLAGS) -c $<

# recompile all objects if a include file have been updated
$(OBJS): $(INCS)

# clean the project from .exe and .o files
clean:
	del $(TARGET) $(OBJS)

# run the exec file
run: $(TARGET)
	.\$(TARGET)

